package my.bc.webdav.client.test;

import org.junit.Before;
import org.junit.Test;

public class UtfTester
{
  @Before
  public void prepare(){};


  @Test
  public void testCase()
  {
    try
    {
      String s1 = "1‘2";
      byte bytes[] = s1.getBytes( "UTF-8" );
      StringBuilder sb = new StringBuilder();
      
      for( byte b : bytes )
      {
        System.out.println( String.format( "%X", b ) );
        if( ( b & 0x80 ) != 0 )
          sb.append( String.format( "%%%X", b ) );
        else
          sb.append( (char)b );
      }
      System.out.println( sb.toString() );
    }
    catch( Exception e )
    {
      e.printStackTrace();
    }
  }
}
